import query from '@dfeidao/atom-nodejs/db/query';

interface Message {
	productid: string;
	role_type_id: string;
}

export default async function atom(msg: Message, action_id: string, session_id: string) {
	const systemid = '12';
	const { exec, prepare } = query(action_id, session_id, systemid);
	const productid = msg.productid;
	const role_type_id = msg.role_type_id;

	prepare('pub_role_fields', ['field', 'fieldtitle', 'fieldtype'], { productid, role_type_id }, 199, 1, [], []);
	const [data] = await exec();
	return data;

}

